<template>
  <div class="q-pa-md q-gutter-sm">
    <t-editor
      :required="true"
			requiredMessage="必填不为空"
      labelPosition="left"
      label="必填不能为空"
      ref="editor"
      max-length-msg="字段超过最大字符限制，最大允许${value}字符"
      v-model="editor11111"
      placeholder="请输入内容"
    />

    <button @click="editor11111 = ''">改变editor值</button>
    <button @click="console.log(editor11111)">打印editor值</button>
    <button @click="editor.insertHTML('<b>哈哈哈哈哈</b>')">插入html</button>
  </div>
</template>

<script>
import { ref } from 'vue';

export default {
  setup() {
    const editor = ref();
    const text11111 = ref();
    const textarea = ref();
    const editor11111 = ref('');
    const input160606 = ref();
    const validate = () => {
      // 在这里编写 validate 方法的逻辑
      console.log(editor.value);
      editor.value.validate();
      textarea.value.validate();
    };

    const handleClick = () => {
      // 在点击事件中调用 validate 方法
      validate();
    };

    return {
      editor11111,
      input160606,
      handleClick,
      editor,
      text11111,
      textarea,
    };
  },
};
</script>
